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

Query time 0.00026