UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Cro3pyj6LHC2put17cwDfmq5Q+YforC2IAPVpSx3OY=' 
WHERE 
  key_id = 'a0acd938c9ae2c41097cd21f76822036790dca4abf68be03bba9f7a4242760dc' 
  AND (
    token = '1Cro3pyj6LHC2put17cwDfmq5Q+YforC2IAPVpSx3OY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00133