UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U25cJbM/70YOKK+Mxj01wxcJ9ZJ8+yuzI/TcEavCIac='
WHERE
key_id = '7a337af2145787950364af40c257ef63184a48df00790454338e144063518e6e'
AND (
token = 'U25cJbM/70YOKK+Mxj01wxcJ9ZJ8+yuzI/TcEavCIac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)