UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '//AGU6uXSXDBKa7hjo31QLRssGAXbm2RjMsVXMX26yk='
WHERE
key_id = 'de45fdbabc674975255037863963961fa570bd279dab0ab8f34d5187bf1412f6'
AND (
token = '//AGU6uXSXDBKa7hjo31QLRssGAXbm2RjMsVXMX26yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)