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

Query time 0.00035