UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ko/6QimAAK0kEGdo9P1wos2Ah+8/lguD3x94pPLRlO4='
WHERE
key_id = 'dc5b9835049b793ea0c045bfeee27b2281348592eb774226f7b1def91fdeb3b3'
AND (
token = 'ko/6QimAAK0kEGdo9P1wos2Ah+8/lguD3x94pPLRlO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)