UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NoT0TF/ukDA0jHVYl9emu4J1FXfq0GBILg5vpP2fSM8=' 
WHERE 
  key_id = '5feea066da5da440d0f8e4edabc18d5b56eba489ef897a65210d9133d00e0852' 
  AND (
    token = 'NoT0TF/ukDA0jHVYl9emu4J1FXfq0GBILg5vpP2fSM8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062