UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rAV1bDy5kbUozms5RlvpCHhjKPAuihp1Kr1WjnbJJcM=' 
WHERE 
  key_id = 'a08d1e14368677348e86bca7c51a974865b40ccb30c67fb16be151e3e6d4b717' 
  AND (
    token = 'rAV1bDy5kbUozms5RlvpCHhjKPAuihp1Kr1WjnbJJcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057