UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fjOnPOKduCdX25l2F7B1ua5w0aS9nz81AC1zCXE9i9w=' 
WHERE 
  key_id = '97695be37cdcb6713dd29fb3fe706b0ed90c415731db6200e399079daf086e37' 
  AND (
    token = 'fjOnPOKduCdX25l2F7B1ua5w0aS9nz81AC1zCXE9i9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043