UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YvJNfRlYbcuBifTcYszPiEoV0mZmNPF6GH2xyy3Q6pE='
WHERE
key_id = '9cd0dc84043471739d07821147a61c9acc2476fbae3b4ad36bb4feacb816b316'
AND (
token = 'YvJNfRlYbcuBifTcYszPiEoV0mZmNPF6GH2xyy3Q6pE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)