UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VE3rMDz/Csxn1YE/zihhfDCEajaU0wAXdR3u5EpKgXs='
WHERE
key_id = 'd70297e85a1d735f57eda843fbdcc0a93c42315816f6b0c996823dddaeb3b4a8'
AND (
token = 'VE3rMDz/Csxn1YE/zihhfDCEajaU0wAXdR3u5EpKgXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)