UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mOJDw4LXmH5A+ME2sSoHWeH07SzLxq5DM0bHDbzSquA=' 
WHERE 
  key_id = 'a40d40703d60b4aad4980ed649a69a1bacf4627ea24e69b6550394e96a6c548e' 
  AND (
    token = 'mOJDw4LXmH5A+ME2sSoHWeH07SzLxq5DM0bHDbzSquA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065