UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fkq9lJ/KYXob/7XvvI38isrQ44j735oiyTeR55ZT14Q=' 
WHERE 
  key_id = 'b3c61cb82cde91f8f697edd92557eb8a74415378b93e96de5972f05dd52e2293' 
  AND (
    token = 'Fkq9lJ/KYXob/7XvvI38isrQ44j735oiyTeR55ZT14Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034