UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NsL1AedFfHz2rO0kGqHiUec7VYyygjA3cQcQ4N21008=' 
WHERE 
  key_id = 'cc6ed239c47fd74477ee1e21d82856eba10c2404d49eca77bf9871a7405ad0f4' 
  AND (
    token = 'NsL1AedFfHz2rO0kGqHiUec7VYyygjA3cQcQ4N21008=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038