UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rhhyDWKjMIT/tms2Hps71i9qZoQhlQc1zkJdq9KR4mI='
WHERE
key_id = '5b70bd679c72b526e8934aac21bafbf1b5419e5e6698650073bf3f3a04b3bc1e'
AND (
token = 'rhhyDWKjMIT/tms2Hps71i9qZoQhlQc1zkJdq9KR4mI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)