UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hgSBsIKMUVprRaG32zv2rrmwmv6VrkFgffB37KukeJs='
WHERE
key_id = '9404680f03204b1020acd80985dcb45b257a697a442efccf1600abbb9930f0a6'
AND (
token = 'hgSBsIKMUVprRaG32zv2rrmwmv6VrkFgffB37KukeJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)