UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wFNUPyk24WSqJjelQMZGCvF7H2aeWAeaRQ+22quYWo0=' 
WHERE 
  key_id = 'dce59aa3cdc73e6b355cbcc853472b19c46bcd248470b6c52b1395eb5575d583' 
  AND (
    token = 'wFNUPyk24WSqJjelQMZGCvF7H2aeWAeaRQ+22quYWo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043