UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Q9RiTuMVSYUJCjU1ODMDgqeRw+hFAAvcaCDQf3M3uo=' 
WHERE 
  key_id = '11e7f3cd169e8dfa5477e6f61ab18d9ad0a8fac320de1032a2336835e00ddea2' 
  AND (
    token = '0Q9RiTuMVSYUJCjU1ODMDgqeRw+hFAAvcaCDQf3M3uo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029