UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6YDwqnB7IUUeAZgOwgthlHX9RiAFX+AIEdRbgWcJuoM='
WHERE
key_id = 'bde9922d10279629eaa91746750682159aeb2e0d9bda7634c4ea77bdfb370ca3'
AND (
token = '6YDwqnB7IUUeAZgOwgthlHX9RiAFX+AIEdRbgWcJuoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)