UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9qGxu4PhM2cg3uSC2Y8pMDs5OTScq3UXmKhxrJ8xDEg='
WHERE
key_id = '3b5b8947123c1f81c4d9d998144de2926cd1cbfaf7e107cef55ea4bfee9a0f2b'
AND (
token = '9qGxu4PhM2cg3uSC2Y8pMDs5OTScq3UXmKhxrJ8xDEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)