UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zzw+mAPNlY5cPPsmuLqOVbmUJRdEEh4PskKZ6OA1wt4='
WHERE
key_id = '44fbf07fadf992d1ed401c06ea16aca3594163481445e43f2ea99cb7ad2dc8b5'
AND (
token = 'Zzw+mAPNlY5cPPsmuLqOVbmUJRdEEh4PskKZ6OA1wt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)