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

Query time 0.00036