UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZGCYXnfLPSKP8Tz7Q3AlOjSkSPUIBMbv2YQRkbBKN0A='
WHERE
key_id = 'd53578b7d22de03282c6345ed9dfeaeaae030530b51960a1b626f12c8d70d045'
AND (
token = 'ZGCYXnfLPSKP8Tz7Q3AlOjSkSPUIBMbv2YQRkbBKN0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)