UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'la7YDJu2myI6RtxZuRyU7thvwSAJF7XOCXgJFDvexdg='
WHERE
key_id = 'cd555bc11187097d96cd8f35c1db083432b11aac8740fc1e9d0dde13b1b12a21'
AND (
token = 'la7YDJu2myI6RtxZuRyU7thvwSAJF7XOCXgJFDvexdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)