UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kHPrZQs2Wqk+C+ucXWU2/xx58mV9913CnHLg/5uRZBE='
WHERE
key_id = '488dc456ede5fd5bdc50acce1ae9d2b94ab4830a09eee5fcc22c77ab0ebc2aa0'
AND (
token = 'kHPrZQs2Wqk+C+ucXWU2/xx58mV9913CnHLg/5uRZBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)