UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TdDOmadxWaJ0zvIlhPhDLn3YNm/l3jWrnX8itbkicUQ=' 
WHERE 
  key_id = '4b7868421bad7f6276ff9b937d927b31e5844aac9abd76e383ec79702fc0716c' 
  AND (
    token = 'TdDOmadxWaJ0zvIlhPhDLn3YNm/l3jWrnX8itbkicUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024