UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1SBY7Tv1jQxtwyGKGBtNRZDuyD8EJcJlWf8CA3Nvpx4='
WHERE
key_id = '07ad4d48139317cb810455c8c723d1087dd3e004351f9b703f0093274cdd7fbf'
AND (
token = '1SBY7Tv1jQxtwyGKGBtNRZDuyD8EJcJlWf8CA3Nvpx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)