UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ZJ/H/Detg7b8goGV0r/x3h3KBbveKu7oSZ7mHCc3+k='
WHERE
key_id = '56a29d254258702afd1aac42641a00dabcec432d30d65c746242dda7d5f75e60'
AND (
token = '+ZJ/H/Detg7b8goGV0r/x3h3KBbveKu7oSZ7mHCc3+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)