UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '238Sy3HkhJtPAfvYqSc8LYW4J9lPL3j8/I8YUAaQYek=' 
WHERE 
  key_id = '9d57f5c104441ace4605043e2a20ea0b459ab092862bea36c65bb2ad1472e9ce' 
  AND (
    token = '238Sy3HkhJtPAfvYqSc8LYW4J9lPL3j8/I8YUAaQYek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015