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

Query time 0.00016